package com.lx.others.biz.impl;

import com.lx.dm.entity.Orders;
import com.lx.others.dao.OrdersMapper;
import com.lx.others.biz.IOrdersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lx.others.vo.DacuOrder;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lx
 * @since 2025-03-01
 */
@Service
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements IOrdersService {

    @RabbitListener(queuesToDeclare = @Queue("dacu_queue"))
    @Override
    public void processDacuOrder(DacuOrder dacuOrder) {
        System.out.println("dacuOrder = " + dacuOrder + "订单处理完成");
        // TODO 保存订单 根据商品id+num生成订单明细
    }
}
